home *** CD-ROM | disk | FTP | other *** search
/ AOL File Library: 4,101 to 4,200 / aol-file-protocol-4400-4101-to-4200.zip / AOLDLs / ADV - Message Board Archives / Archived Msgs_ NDAs & Tools / ADV.NDATOOL.shk / ADV.NDATOOL.LOG
Text File  |  1992-09-13  |  66KB  |  1,830 lines

  1.  
  2. =======================================================================
  3. Archived Messages: "NDA's and Tools"
  4. America Online Apple II Developers Forum.
  5. Go Keyword ADV!
  6. (C) 1992.
  7. ===================================================================jrm=
  8. Discussion of anything unique about using the ToolKit in a New Desk Accessory.
  9.  
  10. Type:      Response       
  11. From:      KatherineL
  12. Date:      88-02-01 07:55:37 EST
  13. 88-02-01 07:55:37 EST
  14. CC:        KatherineL
  15. Re:        Re: NDA's and Tools
  16.  
  17. If you are writing an NDA that requires the Stand File tool is it necessary to
  18. call the Tool Locator startup routine or the Miscellaneous Tools startup
  19. routine?  I am assuming that one has to call Memory Manager to get the memory
  20. id to allocate space for the Std File tool.  If you want to use a window with
  21. zoom and scroll bar is it necessary to call the Desk Manager?  Or can you
  22. assume its presence already?
  23.  
  24.  
  25.  
  26. Type:      Response       
  27. From:      SYSOP jim
  28. Date:      88-02-01 23:37:54 EST
  29. Re:        Re: NDA's and Tools
  30.  
  31. Kathy,
  32. For an application to support NDAs, it has to make sure that these tools are
  33. loaded and initialized: Tool Locator, Memory Manager, QuickDraw II, Event
  34. Manager, Window Manager, Menu Manager, Control Manager, Scrap Manager, Line
  35. Edit and Dialog Manager.  This means your NDA can depend on these tools being
  36. ready to go.  You can make a status call to any other toolboxes your NDA needs
  37. to see if they're available.
  38.  
  39.  
  40.  
  41. Type:      Response       
  42. From:      KatherineL
  43. Date:      88-02-02 23:19:12 EST
  44. 88-02-02 23:19:12 EST
  45. CC:        KatherineL
  46. Re:        Re: NDA's and Tools
  47.  
  48. What effect would it have to StartUp a tool in a desk accessory that is already
  49. active?
  50.  
  51.  
  52.  
  53. Type:      Response       
  54. From:      SYSOP jim
  55. Date:      88-02-03 00:38:59 EST
  56. Re:        Re: NDA's and Tools
  57.  
  58. I don't know what that might do, Kathy - I haven't tried it. I may be wrong,
  59. but it seems to me that you should make the status call to see if the tool is
  60. active during the initialization subroutine and start the tool if it's
  61. inactive. When DeskShutDown is called at the end of the program, the NDA should
  62. shut down any tools it started.
  63.  
  64.  
  65.  
  66. Type:      Response       
  67. From:      KatherineL
  68. Date:      88-02-13 18:03:26 EST
  69. 88-02-13 18:03:26 EST
  70. CC:        KatherineL
  71. Re:        Re: NDA's and Tools
  72.  
  73. I tried what you suggested and it helped a lot.  I've now moved on to bigger
  74. and better bugs in my code!  :)    This program would progress faster if I
  75. didn't spend so much time on here!  :)
  76.  
  77.  
  78.  
  79. Type:      Response       
  80. From:      KatherineL
  81. Date:      88-02-20 18:33:55 EST
  82. 88-02-20 18:33:55 EST
  83. CC:        KatherineL
  84. Re:        Re: NDA's and Tools
  85.  
  86. By the way, is there a maximum allowable size for a NDA aside from the limits
  87. of the machine itself?  (ie Can't put a 512K NDA in the memory of a 256K
  88. machine).
  89.  
  90.  
  91.  
  92. Type:      Response       
  93. From:      TimH66
  94. Date:      88-03-31 00:32:44 EST
  95. 88-03-31 00:32:44 EST
  96. CC:        KatherineL
  97. Re:        Re: NDA's and Tools
  98.  
  99. Katherine,
  100. Actually you can put a 512K program on a 256K machine.  If you use the segment
  101. loader correctly, the GS Loader will load the needed segments in as it needs
  102. them.  As for a DA, I don't know.  I think the limit is 64K (1 bank), but I
  103. really don't know.  I'll try to find out for you though.
  104. - Tim
  105.  
  106.  
  107.  
  108. Type:      Response       
  109. From:      User797
  110. Date:      88-04-02 23:46:52 EST
  111. 88-04-02 23:46:52 EST
  112. CC:        KatherineL
  113. Re:        Re: NDA memory limitations
  114.  
  115. Hey -- if Mac users can use a desk accessory to browse a HyperCard stack, we
  116. can do whatever we want!  :)    /;+/
  117.  
  118.  
  119.  
  120. Type:      Response       
  121. From:      Dave Lyons
  122. Date:      88-07-02 06:09:47 EST
  123. Re:        NDAs and dynamic segments
  124.  
  125. Actually, NDAs can use dynamic segments, too (not just programs).  CDAs can NOT
  126. use dynamic segments, since the Loader (which takes care of loading the
  127. segments when they are called) is not available under ProDOS 8.  The system
  128. will crash violently if you try to use a CDA with dynamic segments (unless it
  129. checks for the presence of P16 at runtime before making ANY calls to dynamic
  130. segments!).
  131.  
  132.  
  133.  
  134. Type:      Response       
  135. From:      Dave Lyons
  136. Date:      88-07-02 06:11:19 EST
  137. Re:        Re: NDA's and Tools
  138.  
  139. To add to what Jim said (months ago, before I was here!):
  140.  
  141. An NDA can make Status calls on toolsets that are not required to be started up
  142. (ex: Standard File); if they aren't, it can call LoadOneTool for them, allocate
  143. direct-page space (bank 0, page-aligned), and start up the toolsets.  When
  144. DeskShutDown is called (and therefore the NDA's Init procedure is called with a
  145. 0 parameter), the NDA should *carefully* reverse anything it did that still
  146. needs to be done:  specifically, it should shut down any toolsets it started IF
  147. they are still active [allow for other NDAs not being as polite as we are!],
  148. and it should unload any toolsets it loaded.
  149.  
  150. When doing a STATUS call from a high-level language (Pascal or C), be SURE to
  151. check for a tool error (TML = ToolErrorNum, C=_toolErr), because the result of
  152. a Status call on a toolset that is not loaded is UNDEFINED--you'll get back
  153. whatever dummy value the compiler pushed onto the stack, which is usually just
  154. garbage left over in a CPU register.  If you get a nonzero tool error as the
  155. result of a status call, then the toolset is not loaded in.
  156.  
  157. Hey!  Let's be *careful* out there!  [I saw one NDA that *unconditionally*
  158. started up Standard File even if it was already started, allocated a direct
  159. page for it--and then when the NDA was closed, it DEALLOCATED the direct page
  160. but LEFT StdFile started up, just waiting for some poor applicatior other DA to
  161. crash everything....]
  162.  
  163.  
  164.  
  165. Type:      Response       
  166. From:      Dave Lyons
  167. Date:      88-07-02 06:37:04 EST
  168. Re:        TLStartUp/ShutDown for Apps only
  169.  
  170. Forgot to say this in my last message:  It's extrememly necessary that ONLY
  171. applications call TLStartUp and TLShutDown.  If a desk accessory or something
  172. makes those calls, the less fortunate parts of the system that are still trying
  173. to make toolbox calls [like the application you're running] will find that some
  174. of the tools aren't in memory anymore!  The system will crash in short order....
  175.  
  176.  
  177.  
  178. Type:      Response       
  179. From:      Dave Lyons
  180. Date:      88-07-05 01:19:51 EST
  181. Re:        NDAs and the Cursor
  182.  
  183. Has anybody seen/written an NDA that changes the cursor to something other than
  184. an arrow when the mouse is over its window?  I may have to try it, because I'm
  185. not sure all of my applications behave correctly...they may try to change the
  186. cursor back to something else while an NDA is the front window.
  187.  
  188.  
  189.  
  190. Type:      Response       
  191. From:      Dave Lyons
  192. Date:      88-07-05 01:21:55 EST
  193. Re:        NDAs and Menus
  194.  
  195. Has anybody seen/written an NDA which installs its own menu in the system menu
  196. bar?  Parts of the toolbox documentation seem to imply this is possible, but I
  197. don't know exactly how.  There's a "DAMenu" event defined for NDAs to receive,
  198. but how do you go about installing the menu so that the system knows to feed
  199. the menu selections to the NDA?  (Last time I checked, it did NOT seem to be
  200. sending *all* menu selections through the front NDA.)
  201.  
  202.  
  203.  
  204. Type:      Response       
  205. From:      AFL Floyd
  206. Date:      88-07-05 14:25:27 EST
  207. Re:        Re: NDA's and Tools
  208.  
  209. Dave,
  210.  
  211. In regards to the cursor switching in an NDA, you would branch to your cursor
  212. routine in your action table when you get an action code of #3 (for cursor). 
  213. You would only get this action code when the NDA window is the front window.
  214.  
  215. Your cursor routine would save the port, make your NDA window the active port,
  216. and then check the mouse position.  If it is within your content region then
  217. you would switch the cursor.  If it is NOT within the content region you would
  218. switch to the application cursor.
  219.  
  220. A good example of this is in Gary Little's book "Exploring the Apple IIgs".
  221.  
  222. Floyd
  223.  
  224.  
  225.  
  226. Type:      Response       
  227. From:      Dave Lyons
  228. Date:      88-07-05 18:27:43 EST
  229. Re:        NDAs and Cursors
  230.  
  231. Sounds good, but how does the NDA know what is the "Application cursor"?  I
  232. suppose it can just call GetCursorAddr when it is opened (or is there a better
  233. way or better time)?
  234.  
  235. The other question is what the application has to do--I guess it should never
  236. do a SetCursor while an NDA is in front, although it needs to, for example,
  237. change it from an I-Beam to an Arrow when an NDA is opened.  I don't see how to
  238. do this cleanly while still letting TaskMaster take care of opening NDAs
  239. automatically.
  240.  
  241. How about if the appl watches FrontWindow and sets the cursor to an Arrow
  242. *once* when the front window changes from a application window to a system
  243. window?  (That should be fine except maybe for NDAs that set the cursor only
  244. when they think it isn't already set...ugh.)
  245.  
  246.  
  247.  
  248. Type:      Response       
  249. From:      AFL Floyd
  250. Date:      88-07-05 19:22:18 EST
  251. Re:        Re: NDA's and Tools
  252.  
  253. Dave,
  254.  
  255. Yes.  Use GetCursorAdr in your NDA_Open routine and save it.  You should change
  256. the cursor IN the NDA, not the application.  The cursor action routine is
  257. automatically called by taskmaster when your NDA is the front window.  When
  258. your NDA closes it should restore the cursor to the one that was saved when it
  259. opened.
  260.  
  261. I have some source code from Gary Little that demonstrates this cursor stuff. 
  262. Let me know if you want it.
  263.  
  264. Floyd
  265.  
  266.  
  267.  
  268. Type:      Response       
  269. From:      A2Pro Tim
  270. Date:      88-07-05 23:05:12 EST
  271. Re:        Re: NDA's and Menus...
  272.  
  273. Dave,
  274.  
  275.      I'm currently working on an example NDA that will have a menu bar in its
  276. info bar.  It will (hopefully) be published as a "here's how you do it' article
  277. later this year....
  278.  
  279.      There is a RECENT tech note that shows how to do it from APW C.  I plan on
  280. doing it from ORCA/Pascal...
  281.  
  282. Tim S.
  283.  
  284.  
  285.  
  286. Type:      Response       
  287. From:      Dave Lyons
  288. Date:      88-07-06 01:00:19 EST
  289. Re:        Menu bars in NDAs
  290.  
  291. Tim, I actually managed to put a Menu bar in an NDA's info bar (from TML
  292. Pascal).  I haven't yet modified it based on the revised Info Bar technote.
  293.  
  294. I still wonder whether there's a supported way for NDAs to use the system menu
  295. bar, though.
  296.  
  297.  
  298.  
  299. Type:      Response       
  300. From:      Mensch72
  301. Date:      88-07-07 00:32:37 EST
  302. Re:        Re: NDA's and menus
  303.  
  304. Dave,
  305. in fact, No, sorry. NDA's can't put up their own menus in the system menu bar,
  306. since all applications accept all menu actions for themselves ( in fact you
  307. could end up crashing most applications by putting up another menu and
  308. selecting from it!). The best way to do it is, just what you have been doing,
  309. place a menu bar in the windows infobar.
  310.  
  311. Jim
  312. (If you want to check how I arrived at the no, simply examine how taskmaster
  313. works and ask yourself, when would it ever pass a menu event to a DA since it
  314. never knows who the menu event belongs to... something the task master author
  315. never thought of obviously...)
  316.  
  317.  
  318.  
  319. Type:      Response       
  320. From:      Nuzz
  321. Date:      88-07-08 23:38:56 EST
  322. Re:        Re: NDA's and Tools
  323.  
  324. I assume the tech note you're all talking about is IIGS Note #3 "Window Bar
  325. use".  dated 5/88
  326. I'm trying to follow the code in the note about putting a menubar in the info
  327. bar. A few questions:
  328.  
  329. 1. They use a routine to "set size of menu"
  330. Couldn't I use _calcmenusize instead?
  331.  
  332. 2.Another routine they use is"Set flag to tell Menu Mgr to draw menu in current
  333. port"
  334. I thought the menu manager always draws in the current port?
  335.  
  336. Mike  
  337.  
  338.  
  339.  
  340. Type:      Response       
  341. From:      Dave Lyons
  342. Date:      88-07-10 00:59:03 EST
  343. Re:        Menus in Info bars
  344.  
  345. Mike, I think the Menu Manager draws in its own port normally--the one you can
  346. get with GetMenuMgrPort.
  347.  
  348. CalcMenuSize calculates the size of an individual menu, but it doesn't do
  349. anything about the menu bar rectangle itself.  FixMenuBar comes a bit closer,
  350. calculating a "standard" rectangle for the menu bar & calling CalcMenuSize on
  351. each menu.
  352.  
  353. By the way, I noticed that there are TWO places where the revised technote #3
  354. talks about telling the menu manager to "draw in the current port":  It passes
  355. $FFFFFFFF to NewMenuBar, and it also sets the highest bit of the CtlOwner field
  356. of the menu bar record.  Seems redundant to me, and I can't find either of
  357. these in the toolbox ref.
  358.  
  359. Also by the way:  Can someone tell my how giving -1 to NewMenuBar is different
  360. from giving it a pointer to your NDA's window?  And assuming it's different,
  361. when is it useful to pass a window pointer to NewMenuBar?  (The toolbox
  362. reference describes the parameter as "POINTER to window's port; NIL for system."
  363.  
  364.  
  365.  
  366.  
  367. Type:      Response       
  368. From:      Matt DTS
  369. Date:      88-07-10 12:47:08 EST
  370. Re:        Re: NDA's and Tool Startups
  371.  
  372. Jumping back a topic or two:
  373.  
  374. There is MUCH more to the issue of loading and starting up tools which are not
  375. already available than carefully reversing steps at the end of the application.
  376. Take this scenario, for example:
  377.  
  378. An NDA wants to use the List Manager, and finds it's not currently active.  It
  379. loads the tool, allocates the space necessary for it (not sure on what it is -
  380. my manuals are at work) and starts it up.  While the NDA is displaying the NDA
  381. window with the list in it, the user clicks back on the application window, and
  382. the application then decides to use the List Manager, which it had previously
  383. not loaded or started up to save memory.  Uh-oh!  The List Manager is already
  384. started up!
  385.  
  386. Another scenario:  NDA finds the List Manager available, and while displaying
  387. the NDA window with the list in it, the user clicks on the Application window
  388. and closes it, which shuts down and unloads the List Manager (since the
  389. application started it up).  Uh-oh!  What happens when the NDA makes a List
  390. Manager call and isn't prepared to clean up the stack when it gets "tool not
  391. found"?
  392.  
  393. NDA's like those that use Standard File to load a file for viewing are
  394. reasonably safe.  They do SFStatus, LoadOneTool /SFStartUp (if necessary),
  395. SFGetFile (which is a modal dialog), load the file, then
  396. SFShutDown/UnloadOneTool (if necessary).  There's very little chance that the
  397. user could take control away from the NDA before the toolset tht was started up
  398. is properly disposed of.  But for things like the List Manager example given
  399. above, I can't help but recommend that NDA's *NOT* load or startup, or use
  400. tools which are started up that aren't guaranteed to be available to NDAs,
  401. UNLESS the NDA can be reasonably sure that the application won't change the
  402. status of the tool underneath the NDA.
  403.  
  404. The application has the reasonable right to assume that it can start up and
  405. shut down tools it only needs occasionally (like Standard File and the Print
  406. Manager) as it pleases, and shouldn't have to worry about crashing the system
  407. if an NDA has done something unexpected with the tool.  Similarly, the NDA
  408. shouldn't crash the system if it uses a tool the application opened, and
  409. suddenly the tool isn't there anymore.
  410.  
  411. And NDAs should ALWAYS be prepared to deal with LoadOneTool failures for extra
  412. toolsets, instead of crashing the system with a "fatal error" (I've seen this
  413. happen once).
  414.  
  415. (I have every confidence in the world that Mensch will correct me if I have
  416. said anything even slightly incorrect.)
  417.  
  418.                            --Matt
  419.  
  420.  
  421.  
  422. Type:      Response       
  423. From:      Dave Lyons
  424. Date:      88-07-10 17:29:47 EST
  425. Re:        Re: NDA's and Tools
  426.  
  427. Matt, I agree with a lot of that--especially about NDAs being careful not to
  428. crash the system, never causing fatal errors, etc.
  429.  
  430. But I do think NDAs have the right to use any toolsets they need to, and that
  431. guidelines to make this work smoothly should be clafified if that's what we
  432. need.  Seems like one thing that hasn't been discussed enough is what
  433. Applications should do about starting up/shutting down tools in
  434. mid-application.  For example, it seems like applications should be as polite
  435. as NDAs should be: when starting a toolset that an NDA may have started, check
  436. first & don't start it up again; don't shut down a toolset in mid-application
  437. if an NDA may be using it.  Seems straightforward enough to me, but I don't
  438. know how many applications do this sort of thing--other than Standard File
  439. stuff, I don't know of any applications that start toolsets in mid-application.
  440.  
  441. I don't understand the example of quitting an application causing toolsets to
  442. shut down while NDAs remain active.  NDAs don't survive between applications,
  443. and the application is required to call DeskShutDown (which gives all NDAs a
  444. chance to clean up after themselves) BEFORE shutting down other tools--the ones
  445. required for NDAs, at least.  Even if the application is impolite enough to
  446. shut down tools that NDAs may be using before doing DeskShutDown, the NDAs
  447. should be polite enough to notice this & not try to shut them down again.
  448.  
  449. Now, if we had a MultiFinder I guess things would be a lot different--if
  450. somebody wants to invent guidelines on tool use to stay compatible with
  451. environments like this, I'm listening!  (And I DON'T mean guidelines like "NDAs
  452. shouldn't load any extra tools"!  That wouldn't be any fun at all!)
  453.  
  454.  
  455.  
  456.  
  457. Type:      Response       
  458. From:      Parik Rao
  459. Date:      88-07-10 19:28:01 EST
  460. Re:        Re: NDA's and Tools
  461.  
  462.  
  463. Heres a great guideline...
  464.  
  465.  
  466. Tools are ALWAYS active!  YEAH!  Heh, that'd be great.  You don't have to worry
  467. about...
  468.  
  469. "Oh hell, did I already call that sucker?  Better go id it.  Yep, sure did.  Oh
  470. no, its been purged!  Ahhhgghhh!"
  471.  
  472. Or stuff like that.  Instead, of at ProDOS 16 boot, all tools were initialized
  473. and ready to go (eg, all a user has to do is call tools and not _QDstartup or
  474. whatnot), that way tools are ALWYAS active, NEVER shutdown.  This could happen
  475. on a cold-boot also.  Be nice in newer versions of the Apple IIgs.
  476.  
  477. {although I admit tons of memory would be needed...}  
  478.  
  479.  
  480.  
  481. Type:      Response       
  482. From:      Nuzz
  483. Date:      88-07-10 21:54:23 EST
  484. Re:        Re: NDA's and Tools
  485.  
  486. Dave
  487. I think if you pass -1 to newmenubar, then it would draw to the front window.
  488. The example in the tech note sets up the menu BEFORE the window is displayed.
  489. I couldn't find any reference to $FFFFFFFF in newmenubar either. I also
  490. couldn't find CtlOwner or CtlRect. They are probably there somewhere and I'm
  491. missing it.
  492. While on menus and Nda's, how can I disable the system menu when an Nda window
  493. is displayed?  
  494.  
  495.  
  496.  
  497. Type:      Response       
  498. From:      JimMensch
  499. Date:      88-07-11 01:51:38 EST
  500. Re:        Re: NDA's and Tools
  501.  
  502. Since the system menu does not "belong" to you ( I hate to say this it sounds
  503. so authoritarian...) You have no business whatsoever making any changes at all
  504. to it! In fact, any messing you do would be considered a very large nono by the
  505. menu manager and if it caught you, it would probably crash or something!
  506.  
  507. With that said, to disable the system menu bar, simply create a new menu bar
  508. with nothing in it and call setsysbar and setmenubar this will cause your empty
  509. bar to superceed the old sysbar ( rmember to save th old one first so you can
  510. restore it!) the unfortunate side effect will be that the app's menu bar will
  511. be erased... ( you can redraw it by calling setsysbar and setmenubar with the
  512. original sysbar handle ).
  513.  
  514. NOW, as for starting up tools in a DA. We at Apple think thats a really bad
  515. idea! However, their exist those cases when it has to be done, and there are
  516. some guidelines you can follow for your programming pleasure:
  517.     1. Always try to avoid using any tools that are not started
  518.        by the application! ALWAYS!
  519.     2. When step one appears to be impossible, use loadonetool to        load
  520. the tool you want and start it up. First checking to
  521.        be sure that you have all the other tools that it needs
  522.        started up.
  523.     3. ALWAYS shut down any tool you started up! I suggest doing
  524.        this when you are done with it, or at DA Close time.
  525.     4. If you are using tools that an Application has started up
  526.        Simply ( and blissfully ) use them to your hearts content
  527.        having faith that the application will not shut them down
  528.        behind your back. ( I would consider that an application
  529.        bug, after all it is the one causing you the trouble.
  530.        Always remember to blame the other guy!)
  531.  
  532. And if that were not enough, I am now going to yell at each and every one of
  533. you for the BONEHEADED thing some unknown author did to my application with his
  534. stupid DA! To do this I am going to present you with what I consider to be the
  535. most important rule of all in DA's!
  536.  
  537. RULE: Never, ever, ever, when calling a tool, do anything that will cause the
  538. state of the tool you are calling to change as far as the application is
  539. conscerned! The reason I say this is that many of the tools have one place to
  540. store state information, like SANE has a rounding setting, and the Note Synth
  541. has a refresh rate, and the menu manager has the sysbar variable! If you need
  542. to change a global value like the ones above please be sure to restore them to
  543. the way you found them on exit of all your DA routines.
  544.  
  545. Well, I think that covers what I wanted to say...
  546.  
  547. Jim
  548.  
  549.  
  550.  
  551.  
  552. Type:      Response       
  553. From:      A2Pro Tim
  554. Date:      88-07-11 03:02:50 EST
  555. Re:        NDA's CAN add t the SysMenu bar!
  556.  
  557. I hate to argue with the folks at DTS (in particular Jim Mensch), butttttttt  I
  558. know of at least one NDA that _DOES_ add a menu to the system menu bar!!!  It's
  559. called Two Apples and allows the user to access about double the usual number
  560. of NDA's by adding a second Apple menu.
  561.  
  562. Obviously, the _ONLY_ reason that this type of menu CAN be added to the
  563. System's Menu bar by an NDA is because Task Master launches the NDA's for you
  564. when they are selecteed from the second menu.  Guess it's just one of those
  565. "special cases"...
  566.  
  567. Tim S.
  568.  
  569.  
  570.  
  571. Type:      Response       
  572. From:      Nuzz
  573. Date:      88-07-11 18:29:06 EST
  574. Re:        Re: NDA's and Tools
  575.  
  576. I never thought getting yelled at would be educational, but once again, I
  577. learned something from our friend at the COMPANY.
  578. Gee Jim, you should put that "WE at Apple frown........" into a macro, end it
  579. in but, then go on to how it's really done.
  580. All funning aside, thanks for the help.
  581. ps
  582. Even though you still haven't sent me the Ray Russell information yet.
  583. Mike 
  584.  
  585.  
  586.  
  587. Type:      Response       
  588. From:      Dave Lyons
  589. Date:      88-07-11 22:44:00 EST
  590. Re:        Re: NDA's and Tools
  591.  
  592. Jim M, I have a couple of medium-sized problems with some of the stuff a few
  593. messages back.  I agree with you, except for the things I'm about to whine
  594. about here.
  595.  
  596. First, I respectfully suggest, request, and hope that "you at Apple" will stop
  597. thinking that starting tools from NDAs is a bad idea and, instead, solidify
  598. some rules that will make it a Good, safe idea.  People *do* need/want to do
  599. it, and it's easy to do wrong.
  600.  
  601. Number 3 in your list was that an NDA should always shut down any tools it
  602. started up, and that it should start up any tools it has to use that were not
  603. already started by the application.  I agree.  But I don't agree about WHEN the
  604. NDA should shut down a tool it started up.  Consider that an NDA has *no way*
  605. to determine whether a tool was started by the application or by ANOTHER NDA! 
  606. If TWO different NDAs follow your rules w.r.t. the same non-required toolset,
  607. then they will end up violating your rule 4 on each other: assume that toolsets
  608. are not shut down behind your back.  Let A and B be NDAs, both of which need
  609. the Font Manager.  A is opened & sees that the application has not started the
  610. FM; it loads and starts it.  B is opened and finds the FM already available &
  611. assumes it will stay available.  A is CLOSED and (by your rule) shuts down the
  612. FM.  B is still open and will probably crash the system when it tries to call
  613. the FM.
  614.  
  615. For this reason, I suggest that NDAs should reverse their tool
  616. startup/load-on-tool actions *not* when they are closed but when they get a
  617. DAInit call with code 0, meaning that DeskShutDown was called by the
  618. application.
  619.  
  620. Of course, for a toolset (like Std File) that can be started, used, and shut
  621. down, it's safe shut it down as soon as the NDA is finished with it, as long as
  622. it's NOT left open for another NDA to notice.
  623.  
  624. I have used this approach in my "Show Clipboard" NDA (available on CI$ and
  625. GEnie currently, but without source), so if it is going to cause a problem I
  626. want to know about it.  The toolsets in question there are Scrap Manager, Font
  627. Manager, and QD Aux.  It never crashes the system, even if the toolsets are not
  628. available.  FM and QD Aux are needed for displaying PICT info on the clipboard.
  629. If they aren't available, then it only tries to display TEXT.  I will be glad
  630. to upload the TML Pascal source here if you (anyone) are interested.
  631.  
  632. --Dave Lyons
  633.  
  634.  
  635.  
  636. Type:      Response       
  637. From:      JimMensch
  638. Date:      88-07-12 20:28:59 EST
  639. Re:        Re: NDA's and Tools
  640.  
  641. Dave,
  642. Not a bad idea for shuting down the tools in an NDA. I will give it a bit of
  643. though.
  644.  
  645.  
  646.  
  647. About the extra Apple menu, the only reason that works is because taskmaster
  648. automatically handles all menu items between 1 and 255 in a special way, so yes
  649. Adding another DA menu would work because its Item ID's would have to be below
  650. 250 to be DA's. But, I suspect that is not what is desired when most people
  651. want a DA to add a menu. The DA would have no problem adding any menus ( I
  652. never said they would...) Its having your DA called when the menu choice is
  653. made that is the problem. with items below 250 taskmaster automatically makes
  654. an Open call to the proper DA, with any other menu items, it simply passes them
  655. to the application.
  656.  
  657. As an asside, Dave, I agree that their should be guidelines for DA's starting
  658. up tools that cover all situations, unfortunately, those rules are going to be
  659. a little difficult to define. I will however present you with a problem that I
  660. heard today. I was told by a guy who wrote a DA that uses the Note Synth that
  661. he has found 2 or 3 apps that like to start the note synth and shut it down,
  662. during the app (not once but several times) This causes him a bit of trouble,
  663. and unfortunately, it is the right of the App programmer (although I wish we
  664. had never given him that right...).
  665.  
  666. Anyway, thats all for now
  667.  
  668. Jim
  669.  
  670.  
  671.  
  672. Type:      Response       
  673. From:      A2Pro Tim
  674. Date:      88-07-13 00:33:29 EST
  675. Re:        Re: NDA's and Tools
  676.  
  677. Jim,
  678.  
  679.     I agree with your statement that MOST folks want to add menus from NDA's
  680. that do MORE than just access additional NDA's (like Two Apples NDA does).  I
  681. _ONLY_ brought it up to show that it IS possible (jst VERY limited)...  :)
  682.  
  683.      I for one would GREATLY apreciate it if DTS would define a 'standard' for
  684. NDA's that need additional tool sets...  (hint, hint)
  685.  
  686. Tim S.
  687.  
  688.  
  689.  
  690. Type:      Response       
  691. From:      Dave Lyons
  692. Date:      88-07-17 05:26:28 EST
  693. Re:        Re: NDA's and Tools
  694.  
  695. Jim M--Back on 7/11 you mentioned that an NDA can call SetSysBar and SetMenuBar
  696. to replace the application's menu bar with its own (and restore the old one
  697. later).  If I understand you correctly, I'm confused.
  698.  
  699. How will the NDA receive menu events from that menu?  The only thing I can
  700. think of is that TaskMaster will behave as if a MouseDown occured in the NDA's
  701. window & let the NDA call MenuSelect, etc.  This doesn't seem quite right,
  702. though, since I don't see how it could work with applications that don't use
  703. TaskMaster.
  704.  
  705. Also, if an NDA does replace the application's menu with its own, is it
  706. possible to have an Apple menu in the NDA's bar?  (Setting it up should be no
  707. problem...just call FixAppleMenu(...), but can the NDA open a new NDA without
  708. confusing the application?  Non-TaskMaster applications could try to keep track
  709. of the RefNums of open NDAs, right?)
  710.  
  711. --Dave "endless questions" Lyons
  712.  
  713.  
  714.  
  715. Type:      Response       
  716. From:      AFL Jim
  717. Date:      88-07-17 10:19:23 EST
  718. Re:        Re: NDA's and Tools
  719.  
  720. Oh No! Recursive Apple Menus...
  721.  
  722.  
  723.  
  724. Type:      Response       
  725. From:      JimMensch
  726. Date:      88-07-19 02:53:50 EST
  727. Re:        Re: NDA's and Tools
  728.  
  729. Dave,
  730. what I said in the previous message was, that an NDA certainly could change the
  731. system menu bar. However, if you continue reading the transactions, I also
  732. stated that it would be a silly Idea for the most part since the DA couldn't do
  733. anything with it anyway! As for changing the sysbar, certainly put an Apple
  734. menu in your alternate sysbar, thats not only legal, its considered good
  735. programming (the system menu bar should always have an Apple menu, a file menu
  736. and a quit menu in a well behaved/desktop program). I will upload a two sysbar
  737. menu sample program as soon as they sort out the libraries here, It is a
  738. program that shows how to swap sysbars. (I am also working on a way for DA's to
  739. be able to add menu items... but don't tell anyone! he he he)
  740.  
  741. Jim
  742.  
  743.  
  744.  
  745. Type:      Response       
  746. From:      Nuzz
  747. Date:      88-08-01 20:11:14 EST
  748. Re:        Re: NDA windows
  749.  
  750. Does anyone know of a recommended way for an NDA window to copy the content and
  751. vis region of the active port upon an nda open call. I've tried _frontwindow
  752. then _getcontentdraw, _setcontentdraw, without much success.
  753. Mike
  754.  
  755.  
  756.  
  757. Type:      Response       
  758. From:      Dave Lyons
  759. Date:      88-08-02 00:24:38 EST
  760. Re:        getting Vis region?
  761.  
  762. I don't understand what you're trying to do, Nuzz.  Your NDA wants to know
  763. about its OWN window, or about the previously-current port?
  764.  
  765. Anywa, GetContentDraw is going to give you a pointer to the routine that is
  766. called to update the window.  Very different from what you'll get with
  767. GetVisRgnHandle or whatever.
  768.  
  769.  
  770.  
  771. Type:      Response       
  772. From:      Nuzz
  773. Date:      88-08-02 22:25:33 EST
  774. Re:        Re: NDA's and Tools
  775.  
  776. Dave
  777. What I want to do is copy the contents of the previously current window into my
  778. Nda window. I was trying to get the portloc info on the current window before I
  779. changed ports, then set my da content draw to the previous content draw, but I
  780. guess this is not the way to do it.
  781. Mike
  782.  
  783.  
  784.  
  785. Type:      Response       
  786. From:      Dave Lyons
  787. Date:      88-08-02 22:37:02 EST
  788. Re:        stealing old window's contents
  789.  
  790. Mmmm...Okay, at least I see what you're trying to do now.  I'm not sure there's
  791. a way to do what you want.
  792.  
  793. You can find the previously-front window (and therefore its port, since the
  794. port is the first thing in the window record) by feeding YOUR window pointer
  795. into GetNextWindow ("next" = the next one in front-to-back order, so it will be
  796. the one right "behind" yours--"behind" sounds funny if the windows don't
  797. overlap, but it's still what you want).
  798.  
  799. You will have to capture the image BEFORE you open your NDA window if you want
  800. a good chance of salvaging something useful from the old window.  There is *no*
  801. guarantee that there will be anything there, although there *usually* will be,
  802. and you should be able to grab it with CopyPixels or whatever.  Of course,
  803. you'll need to calculate the amount of memory needed and allocate it with
  804. NewHandle.
  805.  
  806. Why do I say there may not be anything in the window for you to capture? 
  807. Because mouse event have priority over update events.  If something just
  808. happened to make the window visible and the user chooses your desk accessory
  809. right away, the window may be partly or completely blank.
  810.  
  811. This may not be a big problem.  If you want, you could probably use CheckUpdate
  812. to find out if the front window needs updating (or you could use GetUpdateRgn
  813. on it and see if the region is empty--maybe that would be better).  If the
  814. window DOES need updating, you could go ahead and have your NDA open a *tiny*
  815. window behind the menu bar, so as not to obscure the window you're interested
  816. in.  (Of course, watch out for that window suddenly becoming the
  817. SECOND-to-front window when you open yours, unless you specify the "behind
  818. pointer" appropriately in your NDA's window.)
  819.  
  820. I hope this gets your started.  Good luck!
  821.  
  822.  
  823.  
  824. Type:      Response       
  825. From:      Nuzz
  826. Date:      88-08-05 23:18:22 EST
  827. Re:        Re: NDA's and Tools
  828.  
  829. Thanks for the help Dave. I've done almost what you suggested. I opened a one
  830. pixel window behind the menu bar, and set my port to the menumgrport ( I have
  831. to draw a rectangle on the screen) The menumgrport works fine because it is
  832. always (on screen) when the Nda is called. Now, all I have to figure out is how
  833. to save the pixels in the rectangle. CopyPixels should do it.
  834. Thanks
  835. Mike
  836.  
  837.  
  838.  
  839. Type:      Response       
  840. From:      AFL Jim
  841. Date:      88-09-25 16:28:48 EST
  842. Re:        NDAs and special menu items
  843.  
  844. Dave Lyons has noticed the trend of publishers to NOT support the scrap
  845. manager. This means you can't CUT or COPY text or graphics from an application
  846. onto the clipboard, quit, run another application and then PASTE that text or
  847. graphics into the second application. I've noticed a similar problem.
  848.  
  849. Most applications DON'T support passing the special menu items on to NDAs. The
  850. special menu items are Undo, Cut, Copy, Paste, Clear, and Close. What this
  851. means is those applications won't let you use desk accessories that depend on
  852. those menu items being passed to them. Programs that use TaskMaster and define
  853. those items with the correct menu item numbers should work OK - most either
  854. aren't using TaskMaster or aren't using the menu item ID numbers assigned for
  855. those special items. The ID numbers used should be:
  856.  
  857. Hex    Decimal  Description
  858. -----  -------  -----------
  859. $00FA  250      Reserved for Undo edit item
  860. $00FB  251      Reserved for Cut edit item
  861. $00FC  252      Reserved for Copy edit item
  862. $00FD  253      Reserved for Paste edit item
  863. $00FE  254      Reserved for Clear edit item
  864. $00FF  255      Reserved for Close command item
  865.  
  866. See page 13-16 in the "Apple IIGS Toolbox Reference" for the menu ID number
  867. assignment information. Gary Little's book, "Exploring the Apple IIGS", also
  868. give correct information in the Using Pull-down Menus chapter.
  869.  
  870.  
  871.  
  872. Type:      Response       
  873. From:      Dave Lyons
  874. Date:      88-09-25 22:44:07 EST
  875. Re:        NDAs & Scrap Manager
  876.  
  877. If an application passes key-down events correctly to NDAs, you can still use
  878. undo/cut/copy/paste/clear if the NDA supports Apple-Z, -X, -C, -V, and the
  879. Clear and Delete keys.  (This covers the case where TaskMaster is used but the
  880. application uses its own menu item numbers for the Edit stuff and fails to call
  881. SystemEdit with the appropriate code when one of them is chosen.  The
  882. application can tell that the front window is an NDA by calling GetSysWFlag on
  883. the FrontWindow when FrontWindow returns something non-nil.  [Pitfall:  Don't
  884. call GetSysWFlag (FrontWindow) if FrontWindow could be nil--GetSysWFlag can
  885. return TRUE in that case and lead to a crash if you go ahead and do things that
  886. assume the front window is an NDA!])
  887.  
  888.  
  889.  
  890. Type:      Response       
  891. From:      TMH2
  892. Date:      88-12-17 00:09:58 EST
  893. Re:        Re: NDA's and WindowManager
  894.  
  895. (This should perhaps be under Window Manager, but here goes).
  896.  
  897. I feel stupid for asking this, because it seems so simple.  I have an
  898. application which uses TaskMaster and which has a modeless dialog, so it is
  899. using IsDialogEvent/DialogSelect (just FYI).  It works perfectly, except for
  900. with the MEMORY NDA, which APPEARS to use a modeless dialog (maybe it's just a
  901. window, though).  If that NDA is open, and is the active window, key
  902. equivalents for menu selections do not work.  The File menu, for example, does
  903. not flicker when I use the Close equiv. key.  As I said, everything else,
  904. including my modeless dialog, work fine; in addition, my dialog doesn't even
  905. have to be open for this error to appear.  Is this my code's fault, or the
  906. NDAs?  or TaskMaster?  or whose???
  907.  
  908. Z^\GGGGGGGGGGGGGGGGGGG\_
  909. Z                     R
  910. Z  T. Mike Howeth II  N
  911. Z  Dallas, Texas      N
  912. Z  (TMH2)             V
  913. Z                B    Q
  914. ZO    WVWVWVWVWVWVWVWVP_
  915.  
  916.  
  917.  
  918. Type:      Response       
  919. From:      Dave Lyons
  920. Date:      88-12-17 01:21:10 EST
  921. Re:        NDAs and Apple-keypresses
  922.  
  923. Everything's working just how it's supposed to, TMH:  key equivalents do _not_
  924. work while a NDA window is in front; instead the key-down events get passed to
  925. the NDA, which may or may not do anything with them.  (I think the only
  926. exceptions are Apple-Z, X, C, V for Undo, Cut, Copy, Paste, _if_ the Edit menu
  927. items are numbered 250-254 like they should be.  In that case, the NDA receives
  928. an Edit event through SystemEdit instead.)
  929.  
  930. By the way, there's no way to tell the difference between a window and a
  931. modeless dialog by looking at them, but as far as I know all NDA windows need
  932. to be plain windows and not modeless dialogs.
  933.  
  934. --Dave
  935.  
  936.  
  937.  
  938. Type:      Response       
  939. From:      AFL Jim
  940. Date:      88-12-17 21:25:45 EST
  941. Re:        NDAs and Standard Edit Items
  942.  
  943. Dave's right (again). From tests I've done, I've found that many applications
  944. don't use the standard item numbers for undo (250), cut (251), copy (252),
  945. paste (253), clear (254), and close (255) or don't handle NDAs correctly in
  946. other ways. By using the standard item numbers, NDAs such as mini-editors,
  947. scrapbooks, clipboard viewers will be able to use the pull-down menus for edit
  948. commands with applications using TaskMaster. Also, applications should enable
  949. these menu items when the top window is a system window (NDA window).
  950.  
  951. If you're writing an application that doesn't use TaskMaster, you still should
  952. carefully read the TaskMaster section in the Apple IIGS Toolbox Reference
  953. (pages 25-118 to 25-126). Included is pseudocode that shows how TaskMaster
  954. handles events. This might remind you of some things your application should be
  955. doing when it handles events.
  956.  
  957. Jim L
  958.  
  959.  
  960.  
  961. Type:      Response       
  962. From:      TMH2
  963. Date:      88-12-18 01:55:22 EST
  964. Re:        Re: NDA's and Tools
  965.  
  966. Thank you both.  As for correct item numbers, I was very careful when creating
  967. my desktop-environment source-code template that I adhered to the standards on
  968. these sorts of points.
  969. I'm glad to know that the key equivs aren't supposed to work w/ an NDA open,
  970. 'cos I sure couldn't find any problem with my code in that area!  Thanks again.
  971.  
  972. Z^\GGGGGGGGGGGGGGGGGGG\_
  973. Z                     R
  974. Z  T. Mike Howeth II  N
  975. Z  Dallas, Texas      N
  976. Z  (TMH2)             V
  977. Z                B    Q
  978. ZO    WVWVWVWVWVWVWVWVP_
  979.  
  980.  
  981.  
  982. Type:      Response       
  983. From:      AFL Jim
  984. Date:      88-12-18 20:33:43 EST
  985. Re:        Edit Menu Keyboard Equivalents
  986.  
  987. The key equivalents *will* work on the 5 edit menu items listed if your
  988. application uses TaskMaster (or acts the same) and if your NDA handles
  989. SystemEdit calls.
  990.  
  991. Jim
  992.  
  993.  
  994.  
  995. Type:      Response       
  996. From:      TMH2
  997. Date:      88-12-20 00:22:58 EST
  998. Re:        Re: NDA's and Tools
  999.  
  1000. SO the bottom line in the situation I described above is that the NDA is not
  1001. calling SystemEdit so that the key equiv can be passed up the line to my
  1002. application, right?
  1003.  
  1004. Z^\GGGGGGGGGGGGGGGGGGG\_
  1005. Z                     R
  1006. Z  T. Mike Howeth II  N
  1007. Z  Dallas, Texas      N
  1008. Z  (TMH2)             V
  1009. Z                B    Q
  1010. ZO    WVWVWVWVWVWVWVWVP_
  1011.  
  1012.  
  1013.  
  1014. Type:      Response       
  1015. From:      AFL Jim
  1016. Date:      88-12-20 18:24:15 EST
  1017. Re:        NDAs, Edit menu and TaskMaster
  1018.  
  1019. Mike,
  1020.  
  1021. When a NDA is active, the only reasons I can think of an application using
  1022. TaskMaster wouldn't call SystemEdit for the undo, cut, copy, paste and clear
  1023. menu items or wouldn't call CloseNDAbyWinPtr when the close menu item is
  1024. selected are:
  1025.  
  1026. o  The standard menu item numbers for undo..close (250..255) were not used.
  1027. o  Taskmaster TaskMask bit tmSpecial (bit 12) is 0.
  1028.  
  1029. The NDA might not accept the SystemEdit call. In that case, the NDA will
  1030. (should) return FALSE to the SystemEdit call and TaskMaster will return
  1031. wInSpecial to your application with the low word of wmTaskData holding the ID
  1032. of the selected menu item and the high word of wmTaskData holding the ID of the
  1033. selected menu.
  1034.  
  1035. Jim Luther
  1036.  
  1037.  
  1038.  
  1039. Type:      Response       
  1040. From:      Dave Lyons
  1041. Date:      88-12-21 04:59:46 EST
  1042. Re:        what SystemEdit does
  1043.  
  1044. Right...what Jim said.  SystemEdit gets called by an application directly, or
  1045. indirectly by TaskMaster when the application calls TaskMaster.  It's
  1046. responsible for feeding Edit events _to_ NDAs when they occur.  Nothing
  1047. originates in an NDA and works its way back up to the application (makes sense:
  1048. applications have main event loops that dispatch things where they should go;
  1049. NDAs get called and return as soon as they can).
  1050.  
  1051. --Dave
  1052.  
  1053.  
  1054.  
  1055. Type:      Response       
  1056. From:      AFL Jim
  1057. Date:      89-01-16 18:01:21 EST
  1058. Re:        New Desk Accessories
  1059.  
  1060. (Moved Message)
  1061.  
  1062. Subj:  New Desk Accessories                  89-01-16 01:56:54 est
  1063. From:  SteveAllen                            Msgs:  1 (89-01-16)
  1064.  
  1065. I am trying to write a new desk acc. using a modeless dialog. The only way I
  1066. can get the Dialog Items to respond is by calling TaskMaster withing the NDA
  1067. Action loop. The is due to _IsDialogEvent and _SelectDialog both reguiring a
  1068. pointer to the Event Record. It seems I should not have to call TaskMaster
  1069. inside an NDA. Can you help?
  1070.  
  1071.  
  1072.  
  1073. Type:      Response       
  1074. From:      Dave Lyons
  1075. Date:      89-01-16 21:38:36 EST
  1076. Re:        NDAs using modeless dialogs
  1077.  
  1078. I don't think using modeless dialogs from NDAs is something you're supposed to
  1079. be able to do.
  1080.  
  1081. You definitely can't assume that the application is using TaskMaster.  If you
  1082. try to call IsDialogEvent or DialogSelect, you might be able to synthesize an
  1083. event record, but it'd be some work.
  1084.  
  1085. Probably both safest and simpest to have your NDA be a regular window and do
  1086. the FindControl and TrackControl calls yourself.
  1087.  
  1088. --Dave Lyons
  1089.  
  1090.  
  1091.  
  1092. Type:      Response       
  1093. From:      PGauthier
  1094. Date:      89-09-14 21:34:49 EST
  1095. Re:        NDA with no close box
  1096.  
  1097. Is it possible to write a NDA that does not have a close box in its window, nor
  1098. a title, but instead is "closed" by hitting the "esc" key?  I want to use the
  1099. entire screen for a picture.  All the docs I know of seem to imply that the
  1100. only way to tell the system a NDA needs to be closed down is for the user to
  1101. click in the close box.
  1102.  
  1103. Paul G.
  1104.  
  1105.  
  1106.  
  1107. Type:      Response       
  1108. From:      AFL Floyd
  1109. Date:      89-09-16 17:41:26 EST
  1110. Re:        NDA with no close box
  1111.  
  1112. Paul,
  1113.  
  1114. Couldn't you just call CloseNDAbyWinPtr(windowPtr); when you notice the ESC key
  1115. being pressed?
  1116.  
  1117. Floyd
  1118.  
  1119.  
  1120.  
  1121. Type:      Response       
  1122. From:      PGauthier
  1123. Date:      89-09-16 20:15:26 EST
  1124. Re:        Re: NDA with no close box
  1125.  
  1126. Floyd,
  1127.  
  1128. I tried that and nothing happened. The window didn't close.
  1129.  
  1130. Paul
  1131.  
  1132.  
  1133.  
  1134. Type:      Response       
  1135. From:      Dave Lyons
  1136. Date:      89-09-19 20:44:13 EST
  1137. Re:        NDA closing itself?
  1138.  
  1139. I'm not sure it's a good idea for an NDA to call CloseNDAByWinPtr on itself
  1140. (even if it works).
  1141.  
  1142. Note that (starting with System Software 4.0) it's okay for your NDA's Open
  1143. routine to do something *modal* and then return NIL for the returned window
  1144. pointer--that way, the NDA would never really be open, as far as the Desk
  1145. Manager is concerned.
  1146.  
  1147. --Dave
  1148.  
  1149.  
  1150.  
  1151. Type:      Response       
  1152. From:      Sir AWGS
  1153. Date:      89-09-27 01:53:00 EST
  1154. Re:        Re: NDA's w/ No Close Box...
  1155.  
  1156. I had no trouble doing this with Calculator - on the DeskWorks package - I used
  1157. CloseNDAbyWindowPtr with no trouble.
  1158.  
  1159. -Tom
  1160.  
  1161.  
  1162.  
  1163. Type:      Response       
  1164. From:      Windrider5
  1165. Date:      89-10-05 20:43:20 EST
  1166. Re:        Re: NDA's using APWC
  1167.  
  1168. I am intereseted in writing NDAs using APWC.  I have read Tim Swihart's
  1169. articles describing the procedure for writing NDAs using ORCA/Pascal. My first
  1170. question is: Can an NDA be written in APWC using a similar procedure.  (the
  1171. pascal code seems relatively simple in that it does not seem to have to deal
  1172. with perserving and restoring the data bank register )  and if it can be how
  1173. might I be able to implement it.
  1174. My second question is: if NDAs in C can not be written as in Pascal,  do I have
  1175. to follow the procedure as described in the APWC manual (pg 3-9) and in the DA
  1176. sample code written by G. Ortiz of Apple Computer?  If that is the case, it
  1177. would appear that I can not write an NDA in APWC without giving credit to Apple
  1178. computer.   This does not really matter, but it seems like there should be some
  1179. alternatives.
  1180.  
  1181.  
  1182.  
  1183. Type:      Response       
  1184. From:      Coach101
  1185. Date:      89-10-21 10:33:15 EST
  1186. Re:        Credit To Apple....
  1187.  
  1188. If you use Apple's sample code, then I guess you would have to mention them in
  1189. the credits.
  1190.  
  1191. If you look at what they did and do it yourself (not a direct transliteration)
  1192. then I do not see why you would have to give them credit.  After all, none of
  1193. use put up a credit to Ada, Knuth, Dykstra, etc., with our programs and we use
  1194. a lot of what those people found and published.
  1195.  
  1196.  
  1197.  
  1198. Type:      Response       
  1199. From:      Coach101
  1200. Date:      89-10-29 15:23:29 EST
  1201. Re:        NDA Init Entry.......
  1202.  
  1203. I have a desk accessory that is behaving as if the INIT function is not always
  1204. being entered with the (A) register set to indicate that it is a StartUp (a <>
  1205. 0) call.  I have inserted SysBeep calls in the init function (1 bell for
  1206. ShutDown and 2 bells for StartUp).
  1207.  
  1208. Does anyone have any suggestions for pursuing this problem.  I have tried
  1209. inserting BRK instructions at entry (so that GSBug {init incarnation} will get
  1210. control) but the K/PC upon entry to GSBug appears invalid (i.e., the code at
  1211. K/PC does not contain a BRK and is not anything close to my code).
  1212.  
  1213. Also, has anyone else had problems with NDA init functions?
  1214.  
  1215.  
  1216.  
  1217. Type:      Response       
  1218. From:      Coach101
  1219. Date:      90-04-08 21:29:06 EST
  1220. Re:        Multiple Windows Per NDA
  1221.  
  1222. The following messages were moved here from another folder...
  1223.  
  1224. -----------------------------------------------------------------
  1225.  
  1226. Subj:  Multiple Windows in an NDA...??      89-11-14 02:09:00 EDT
  1227. From:  Steve S816                           Msgs:  4 (89-11-22)
  1228.  
  1229. I'm writing an NDA that performs many functions.  Some of the functions require
  1230. an additional window.  While the main window is declared to be a Sys window and
  1231. has its pointer passed internally to the Desk Mgr when the NDA is opened, I
  1232. can't seem to get the additional window to be recognized as a system window. 
  1233. The call _SetSysWindow seems to do its job as far as marking it as a Sys
  1234. window, but all of the Events that are associated with the second window are
  1235. all grabbed by the underlying application and not passed along to me to handle.
  1236.  
  1237. I am calling: _NewWindow, _SetSysWindow, _SetPort, _NewControl(s).  This second
  1238. window has an info bar which gets properly constructed during the NewWindow
  1239. call.  The code has been thoroughly tested (and works) under 'stand-alone' or
  1240. 'modal' conditions; that is, with it's own event loop using TaskMaster.
  1241.  
  1242. Is it even possible for one modeless NDA to have 2 simultaneous regular
  1243. (drag/zoom/infobar/scrollbars) windows?  (I already have modal dialogs and
  1244. alerts that properly pop up over the main window).  If so, what am I missing? 
  1245. If not, how can I add & remove an info bar to an existing window (to eliminate
  1246. the need for the second window)?
  1247.  
  1248. Thanks,
  1249. Steve Stephenson
  1250.  
  1251. -----------------------------------------------------------------
  1252.  
  1253. Subj:  I Had The Same Question....          89-11-15 01:29:31 EDT
  1254. From:  Coach101
  1255.  
  1256. After much thought and I decided that there is a decided problem here.  One
  1257. solution I came up with is to have the "mother" NDA install a new NDA (the
  1258. subordinate window you are looking for).  Then you could Open the new NDA and
  1259. later Close and remove the new NDA.  I did not finish researching this but
  1260. there was one stumbling block I had not found an answer to; on one of the calls
  1261. I needed to use above (install/open/close/remove) I had to specify an NDA
  1262. number instead of an NDA name and I did not find a way to move between numbers
  1263. and names.
  1264.  
  1265. The solution I finally settled on was to open a new window and then "trap" the
  1266. user in the window.  I would use GetNextOSEvent and if the event was within the
  1267. new window I would call TaskMasterDA with the event.  If the event was not
  1268. within the new window I would ring the bell and go back for another event.
  1269.  
  1270. This sort of gets what you want but has drawbacks (you have trapped the user in
  1271. a window).
  1272.  
  1273. Anyway, all of this belongs further down in the WindowManager folder so..
  1274.  
  1275. Would some kind, generous, helpful, forum type move this discussion down to the
  1276. Window Manager or NDA folders....
  1277.  
  1278. -----------------------------------------------------------------
  1279.  
  1280. Subj:  one window per NDA                   89-11-21 23:07:07 EDT
  1281. From:  Dave Lyons
  1282.  
  1283. The short answer is that an NDA can only have one (modeless) window.  You only
  1284. get the events for the window that your DAOpen routine returned a pointer to.
  1285.  
  1286. I don't know of a way to add and remove an info bar from a window--you may have
  1287. to make it *look* like you have an info bar sometimes, by drawing in the
  1288. content area.
  1289.  
  1290. --Dave
  1291.  
  1292. -----------------------------------------------------------------
  1293.  
  1294. Subj:  thanks                               89-11-22 21:46:51 EDT
  1295. From:  Steve S816
  1296.  
  1297. Thanks guys, I've decided to go with a modal dialog (gonna be a whopper of a
  1298. filter procedure).
  1299.  
  1300. Steve
  1301.  
  1302. -----------------------------------------------------------------
  1303.  
  1304.  
  1305.  
  1306. Type:      Response       
  1307. From:      Coach101
  1308. Date:      90-04-08 21:31:47 EST
  1309. Re:        ScrollBars In NDA Windows
  1310.  
  1311. The following messages were moved from another folder
  1312.  
  1313. -----------------------------------------------------------------
  1314.  
  1315. Subj:  NDA Window Scroll bars               89-11-03 22:11:55 EDT
  1316. From:  WinkieJim                            Msgs:  5 (90-04-05)
  1317.  
  1318. Ok, I'll start this off simple are there any trick to get scroll bars working
  1319. on a NDA System window (or ordinary window for that mater). There is nothing
  1320. mentioned in the Toolbox refs about having to handle the scroll bars myself. I
  1321. would hope that TAskmaster took care of them...if not what needs to be done...
  1322.  
  1323. thanks...
  1324.  
  1325. Jim
  1326.  
  1327. -----------------------------------------------------------------
  1328.  
  1329. Subj:  TaskMaster Will Do It....            89-11-04 02:05:56 EDT
  1330. From:  Coach101
  1331.  
  1332. For an NDA that means you need to use TaskMasterDA (see the discussion further
  1333. down on calling it properly) and set the appropriate bits in the
  1334. wmTaskRecord.TaskMask.
  1335.  
  1336. To get snappy scrolling you will need to specify a content draw routine for
  1337. your window when you create the window and remember to only draw the material
  1338. that is necessary (i.e., dont redraw the whole window and let the system "clip
  1339. out" the material that is not visible {it will work but it may be too slow for
  1340. you}).
  1341.  
  1342. -----------------------------------------------------------------
  1343.  
  1344. Subj:  Re:NDA Windows                       89-11-04 18:32:51 EDT
  1345. From:  WinkieJim
  1346.  
  1347. Thanks, I just got the toolbox vol 3 beta draft today and see that it would be
  1348. easy using TaskMasterDA...I wonder how it's done in the pre 5.0 days... (you
  1349. know the ancient times)
  1350.  
  1351.  
  1352. Thanks
  1353.  
  1354. Jim
  1355.  
  1356. -----------------------------------------------------------------
  1357.  
  1358. Subj:  how to do NDA scroll bars before 5.0 89-11-07 01:56:12 EDT
  1359. From:  Dave Lyons
  1360.  
  1361. Basically, nobody did.  I saw one piece of sample code doing it, and it was
  1362. reasonably complicated:  you had to create your own scroll bars, compute where
  1363. they were & leave that area out of the clip region when you redraw, and do your
  1364. own scroll-bar action procedure that calls your draw routine to redraw parts of
  1365. your content while the scrolling is happening.
  1366.  
  1367. TaskMasterDA is much more fun.
  1368.  
  1369. -----------------------------------------------------------------
  1370.  
  1371. Subj:  huh?                                 90-04-05 22:07:56 EDT
  1372. From:  Emmet2
  1373.  
  1374. I guess this means I should get vol 3 now?!?!  I have the first two, but I am
  1375. as confused as it sounds like he was as to how to set up a scroll bar... and
  1376. all I want is a simple one that I know the amount of scroll before hand ... 50
  1377. line items, with maybe 5 visible at a time ... but it still seems like ...
  1378. nevermind you get the idea ...
  1379.  
  1380. -----------------------------------------------------------------
  1381.  
  1382.  
  1383.  
  1384. Type:      Response       
  1385. From:      AFA Gary J
  1386. Date:      90-09-05 00:18:26 EST
  1387. Re:        NDA Menus (moved messages)
  1388.  
  1389.  
  1390. Subj:  NDA Menus                             89-09-29 16:31:26 EDT
  1391. From:  Crockett7                             Msgs:  6 (89-10-15)
  1392.  
  1393.   Im thinking of writing an NDA for System v5.0 using TML Pascal II, and would
  1394. like to know if there is a way to, once an NDA is opened, have the NDA insert a
  1395. Menu to the system menu bar and be able to process commands that were chosen
  1396. from the pull-down menu?  I think the insertion could be done with the regular
  1397. commands InsertMenu(... but I am unsure how the NDA would get action commands
  1398. when the user selects an item.  It can be done on the Mac [gasp!] but Im unsure
  1399. about the GS.
  1400.    Thanks
  1401.  
  1402.  
  1403. Subj:  Re: NDA Menus                         89-10-02 22:31:27 EDT
  1404. From:  JonahS
  1405.  
  1406. I think it could be done, but it probably shouldn't. Remember the Golden NDA
  1407. suideline: No NDA shall alter the system environment when it's not in control.
  1408. Think of AWGS, that is constantly changing the menus, ao PWG were the menus go
  1409. all the way across the screen. What whould happen then? I think it would be
  1410. safest not to try it. If the NDA needs a menu, you can put one in it's window.
  1411. Check out IIGS Tech Note #3 for info on that.
  1412.  
  1413. Jonah
  1414.  
  1415.  
  1416. Subj:  Re: NDA Menus                         89-10-04 00:05:38 EDT
  1417. From:  JDavies1
  1418.  
  1419. Check out the Autumn issue of Call A.P.P.L.E. there is an article
  1420. by Tim Swihart that would be helpful. The article discusses the
  1421. two apple NDA and how it works. It's really interesting.
  1422.  
  1423. JD
  1424.  
  1425.  
  1426. Subj:  Re: NDA Window Menus                  89-10-09 23:05:57 EDT
  1427. From:  JonahS
  1428.  
  1429. Yup, you can put menus in windows. You can either add them to an information
  1430. bar, if the window has a vertical scroll bar (see TN #3 for this) or you could
  1431. just do a _NewMenu on that window, etc., then _SetMenuBar to make it current. I
  1432. tried it a long time ago, and I think it worked....
  1433.  
  1434. Jonah
  1435.  
  1436.  
  1437. Subj:  Re: NDA Window Menus                  89-10-09 23:08:38 EDT
  1438. From:  JonahS
  1439.  
  1440. Huh? Why did I say that? I'm not quite sure where that last post came from. I
  1441. think I fell asleep and my fingers typed it all by themselves. It has nothing
  1442. to do with anything. Geez. I think I'll go to bed and get some sleep. :(
  1443.  
  1444. Jonah
  1445.  
  1446.  
  1447. Subj:  NDA's and the menu bar...             89-10-15 23:04:03 EDT
  1448. From:  A2Pro Tim
  1449.  
  1450. I believe that Two Apples NDA will be about the only NDA ever to successfully
  1451. add a menu to the SYSTEM menu bar and have its contents work correctly!  Why? 
  1452. Because there is no way for the NDA to know when something has been selected
  1453. from a SYSTEM menu (Two Apples doesn't need to know - the system handles NDAs,
  1454. not Two Apples <grin>).
  1455.  
  1456. If you want to use menus from an NDA, then put the menus in your NDA's window
  1457. (either pull down menus in the Info bar or pop up menus some where in the
  1458. window...).
  1459.  
  1460. Tim S.
  1461. (yep, I'm the guy who wrote Two Apples)  :-)
  1462.  
  1463.  
  1464.  
  1465.  
  1466. Type:      Response       
  1467. From:      AFA Gary J
  1468. Date:      90-09-05 00:25:04 EST
  1469. Re:        NDA Menu Events (moved messages)
  1470.  
  1471.  
  1472. Subj:  NDA Menu Events                       89-10-15 21:59:00 EDT
  1473. From:  GGrant2                               Msgs:  10 (89-10-31)
  1474.  
  1475.   I'm writing an NDA, and I'm using the "MenuSelect" call for the window's menu
  1476. bar, which I'm supposed to use. However, the toolbox Ref. manual says that the
  1477. call returns the Menu/Item numbers in the Hi/Low words of the Long value WHEN
  1478. in the taskrec. WELL, this isn't true - when contains the tick count when the
  1479. even happened, just like it's NOT supposed to. What's the deal? Is this
  1480. something new to system 5.0, or has it always been this way?
  1481.   GGrant2
  1482.  
  1483.  
  1484. Subj:  Re: NDA Menu Events                   89-10-16 23:07:37 EDT
  1485. From:  JonahS
  1486.  
  1487. I thought that the Menu/Item numbers were supposed to be in the wmTaskData
  1488. field....
  1489.  
  1490. Jonah
  1491.  
  1492.  
  1493. Subj:  But...                                89-10-18 18:58:39 EDT
  1494. From:  GGrant2
  1495.  
  1496.   They would be, but I'm trying to get them from an NDA; I don't think you can
  1497. do it that way. does anyone know how to use the "TaskMasterDA" call, then?
  1498.   GGrant2
  1499.  
  1500.  
  1501. Subj:  Re: NDA Menu Events                   89-10-21 02:22:47 EDT
  1502. From:  JonahS
  1503.  
  1504. GGrant,
  1505.  
  1506. You could get the Toolbox Ref v3 from APDA, or I could post that one call....
  1507.  
  1508. Jonah
  1509.  
  1510.  
  1511. Subj:  Re: NDA Menu Events                   89-10-21 20:46:24 EDT
  1512. From:  GGrant2
  1513.  
  1514.   Wow, it would be great if you could post just how TaskMasterDA works, as it
  1515. would be really helpful for me...
  1516.   GGrant2
  1517.  
  1518.  
  1519.  
  1520.  
  1521. Type:      Response       
  1522. From:      AFA Gary J
  1523. Date:      90-09-05 00:26:28 EST
  1524. Re:        NDA Menu Events (Moved Messages #2)
  1525.  
  1526.  
  1527. Subj:  Menu item ID                          89-10-25 23:16:14 EDT
  1528. From:  SkySinger
  1529.  
  1530.   As far as Jonah's remark that the Item number is in the wmTaskData field,
  1531. that seems to be true even though the docs say its in 'when' element of the
  1532. event record ('MenuSelect' pg 13-66 of volume 1 says its in the 'when' field).
  1533. I've gotten the ID from  .wmTaskData even when the MainEventLoop of my program
  1534. was using GetNextEvent rather than TaskMaster (works OK since task rec is
  1535. defined as an event record).
  1536.    The pseudo-code for TaskMaster pg 25-122 says the menu ID info is in
  1537. .wmTaskData field of TaskRec.
  1538.   I haven't tried this with NDA items yet.
  1539.  
  1540.  
  1541. Subj:  Ta da (at long last... :)             89-10-28 00:16:52 EDT
  1542. From:  JonahS
  1543.  
  1544. Sorry this has taken me so long. I've been a bit busy:
  1545.  
  1546. Here's the form for the TaskMasterDA call:
  1547.  
  1548. TaskMasterDA $5F0E
  1549.  
  1550. Stack before call:
  1551.  
  1552.     |____________|
  1553.     |___Space____|       Word - space for result
  1554.     |_eventMask__|       Word - Not used
  1555.     |_taskRecPtr_|       Long - Pointer to extended Task Record
  1556.     |            |       <- SP
  1557.  
  1558. Stack after call:
  1559.  
  1560.     |_Previous Contents_|
  1561.     |______taskCode_____|    Word - TaskMaster result code
  1562.     |                   |    <- SP
  1563.  
  1564. Errors:     None
  1565.  
  1566. C:  extern pascal Word TaskMasterDS(eventMask, taskRecPtr);
  1567.  
  1568.     Pointer       taskRecPtr;
  1569.     Word          eventMask;
  1570.  
  1571.  
  1572. Ta da! There you go. I hope this helps and isn't so late that it's of no use to
  1573. you.
  1574.  
  1575. Jonah
  1576.  
  1577.  
  1578. Subj:  Remember....                          89-10-28 12:09:13 EDT
  1579. From:  Coach101
  1580.  
  1581. The ToolBox Volume III manual is "moot" on this but the TaskRecord that you
  1582. pass to TaskMasterDA *must* be your own private TaskRecord.  Copy the event
  1583. information that the DeskManager passed to you into you private TaskRecord and
  1584. then pass this private TaskRecord to TaskMasterDA.
  1585.  
  1586.  
  1587. Subj:  Taskmaster and stuff.                 89-10-30 22:51:11 EDT
  1588. From:  JimMensch
  1589.  
  1590. The menu item information goes into wmTaskData like most everyone has now
  1591. figured out. As you also may have guessed, thats where its supposed to be, and
  1592. if toolbox ref volume 1 says it is in the when field, its wrong...
  1593.  
  1594. By the way, does the TaskmasterDA call mention that you should not only make
  1595. your own copy of the event into your own event record (thanks for pointing that
  1596. out coach) But also that you should also be using the new extended task record
  1597. instead of an old task record... Just thought I would throw another wrench into
  1598. your plans..
  1599.  
  1600. Mensch
  1601.  
  1602.  
  1603. Subj:  TaskMasterDA --- Real Terse           89-10-31 00:28:04 EDT
  1604. From:  Coach101
  1605.  
  1606. Jim, the description of TaskMasterDA in Volume III is so terse I might as well
  1607. type the whole thing in...
  1608.  
  1609.   "This call is the TaskMaster entry point for desk accessories.
  1610.    Your program passes event information obtained from the Desk
  1611.    Manager."
  1612.  
  1613. However, in the stack diagram it does describe taskRecPtr as "Long--Pointer to
  1614. extended Task Record".  So, yes, the description does mention the need for the
  1615. new Task Record though the mention is somewhat oblique.
  1616.  
  1617.  
  1618.  
  1619.  
  1620. Type:      Response       
  1621. From:      AFA Gary J
  1622. Date:      90-09-05 02:13:33 EST
  1623. Re:        NDA -- Runs only once ...? (moved)
  1624.  
  1625. (moved messages)
  1626.  
  1627. Subj:  NDA -- Runs only once ... ?           90-06-06 17:25:49 EDT
  1628. From:  Damien9                               Msgs:  7 (90-06-08)
  1629.  
  1630. Would anyone know why an NDA would only execute the first time the user selects
  1631. it from the menu?  I'm writing an NDA that has no window, and it works the
  1632. first time through, but after that, nothing ( and it doesn't crash the
  1633. machine...). I have a period of -1 (never call for events), and an event mask
  1634. of -1. Any help would be appreciated.
  1635.  
  1636. Thanks,
  1637. Jeff
  1638.  
  1639. P.S.
  1640.  
  1641. Coach, are there any folders on NDA development??
  1642.  
  1643.  
  1644. Subj:  Is it possible                        90-06-06 22:54:46 EDT
  1645. From:  JonahS
  1646.  
  1647. that your code does something like checking to see if the window is already
  1648. open (so that it can bring it to the front when it's menu item is selected
  1649. again) and when you close the window, you forget to reset the flag?
  1650.  
  1651. Jonah
  1652.  
  1653.  
  1654. Subj:  I Dont Remember The Details, but      90-06-07 00:08:33 EDT
  1655. From:  Coach101
  1656.  
  1657. there is some magic about what you report back on an NDA open invocation.  If
  1658. memory serves me correctly, you really want to tell the system you have a
  1659. window (in which case you had really better have a window).  My problem is that
  1660. I can not remember what the restriction/game is; but, I do remember that there
  1661. is some constraint here.
  1662.  
  1663. Yes, there is a folder furhter down for NDA/CDA questions..
  1664.  
  1665. Greg Queen, (aka Coach, aka, Take-A-Lap)
  1666.  
  1667.  
  1668. Subj:  NDA windows...                        90-06-07 01:08:06 EDT
  1669. From:  A2Pro Tim
  1670.  
  1671. Why not have an invisible window for your NDA?  That lets you pass back a real
  1672. window, but not have one show up.  Also, do _NOT_ just use an event mask of -1
  1673. unless you REALLY intend to do something intelligent with all events!!!!  NDA's
  1674. that "eat" key down events, but don't do anything when keys get pressed, are a
  1675. MAJOR annoyment to real users!!!!!  Eating Key down events PREVENTS things like
  1676. menu key equivalents from getting through to the application - meaning I can't
  1677. do OA-Q to quit from an app if the NDA that's the front window eats key presses.
  1678.  
  1679. If you're not doing anything with the event, don't grab it!!!!  :-)
  1680.  
  1681.  
  1682. Tim S.
  1683.  
  1684.  
  1685. Subj:  Only once...                          90-06-07 19:11:26 EDT
  1686. From:  Damien9
  1687.  
  1688. Thanks guys, I'll bet it's the invisible window trick...I vaguely remember
  1689. something about that.  Tim, you're right about the event mask, but I couldn't
  1690. find my calculator so I used what's close....
  1691.  
  1692. Jeff
  1693.  
  1694.  
  1695. Subj:  Don't need calculator for hex...      90-06-08 00:49:17 EDT
  1696. From:  A2Pro Tim
  1697.  
  1698. There's a trick to converting binary to hex (the event mask bits will give you
  1699. binary).  Just group the bits in sets of FOUR.  Each set is ONE digit.  Group
  1700. the resulting four digits to give you the hex equivalent of the bits and use
  1701. the hex value instead of a decimal value for your event mask - makes it easier
  1702. to figure out later also.  :-)
  1703.  
  1704. Why does your NDA not need a window?  Are you sure an NDA is the right thing to
  1705. do for the stuff you're doing?  If it doesn't need a window, then I'd have to
  1706. ask myself if an NDA is what I want or if it should be an INIT or an app or...
  1707.  
  1708.  
  1709. Tim S.
  1710.  
  1711.  
  1712. Subj:  Hex 'n' windows                       90-06-08 19:42:23 EDT
  1713. From:  Damien9
  1714.  
  1715. Tim,
  1716.  
  1717. It's just a silly little screen dump util.  I just wanted to see if I could
  1718. write an NDA.  It'd probably be better as a CDA, I'm going to do it both ways.
  1719.  
  1720. As for the calculator bit, I was being sarcastic, but we don't have a symbol
  1721. for that ... :)
  1722.  
  1723.  
  1724.  
  1725. Type:      Response       
  1726. From:      JR Majka
  1727. Date:      91-08-29 19:34:07 EST
  1728. Re:        NDA's & Print Manager
  1729.  
  1730. I am writing an NDA.
  1731.  
  1732. I am using PrDevOpen and PrDevWrite to send information to the printer, a
  1733. Hewlett-Packard LaserJet IIP.
  1734.  
  1735. With an application running, there is no problem.  In the Finder, however, the
  1736. information never gets to the printer.  I put in a tool error check.  When the
  1737. NDA gets to PrDevOpen and PrDevWrite, I get an error #2.  According to the
  1738. Print Manager error codes, a #2 is "portNotOn  Specified port not selected in
  1739. the control panel."
  1740.  
  1741. That is incorrect.  The printer port is specificied.  Both the ROM control
  1742. panel and the NDA control panel show it to be selected and properly configured.
  1743. I have no problem using the printer with applications.
  1744.  
  1745. When I use the Harmonie port and printer drivers, I get the error and the
  1746. program continues.  When I use Apple's printer port and Imagewriter II driver,
  1747. the system crashes.
  1748.  
  1749. I test for and start up the Font Manager, List Manager and Print Manager if
  1750. they are not loaded and started.
  1751.  
  1752. I also tried putting in PrValidate and PrDefault.  They don't help.
  1753.  
  1754. Any suggestions?
  1755.  
  1756.  
  1757.  
  1758.  
  1759. Type:      Response       
  1760. From:      Matt DTS
  1761. Date:      91-09-01 14:49:59 EST
  1762. Re:        PrDev...
  1763.  
  1764. ...calls are not designed to be called by applications, only by print drivers. 
  1765. They go directly to the port drivers.  Although I can't think of a reason why
  1766. it wouldn't work, it's not guaranteed to work and is definitely not supported.
  1767.  
  1768. Error $0002 is returned by the Tool Locator when that function can't be found,
  1769. which sounds like your code to start up the Print Manager isn't working.  Try
  1770. using Nifty List and see if the Print Manager is started up when you think it
  1771. is.  (Error $1302 is "port not on".)
  1772.  
  1773. If you just want to print text, you should use GS/OS calls and not use the
  1774. Print Manager.  If you're not going to use the
  1775. OpenDoc/OpenPage/ClosePage/CloseDoc/PicFile loop, avoid the Print Manager
  1776. altogether.  The only good exception I can think of is using PrDevAsyncWrite to
  1777. send PostScript to a chosen LaserWriter without using the LaserWriter driver.
  1778.  
  1779. --Matt
  1780.  
  1781.  
  1782.  
  1783. Type:      Response       
  1784. From:      AFC SteveB
  1785. Date:      91-12-23 17:42:14 EST
  1786. Re:        Getting 'em Menu Key equivs...
  1787.  
  1788. I'm on the process of writing an NDA that has a menu bar in it.  What I would
  1789. like to do is be able to catch and handle keyboard equivs. of the menus. 
  1790. Normally, I'd check for a KeyDown message from _TaskMasterDA, but my NDA has a
  1791. text edit control in it, so open apple - character keystrokes are treated like
  1792. events to the text edit control.  Is there any easier way to catch menu key
  1793. equivs., short of setting up my own TextEdit filter procedure?  WriteIt! v2.0
  1794. seems to do it some how...
  1795.  
  1796. Thanks!
  1797.  
  1798. Steve
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.  
  1805. Type:      Response       
  1806. From:      Matt DTS
  1807. Date:      91-12-28 16:36:06 EST
  1808. Re:        I'm missing something...
  1809.  
  1810. If you tell TaskMaster(DA) to handle menu keys, it should do this for you
  1811. automatically.
  1812.  
  1813. (Assuming, of course, that you set the current menu bar to your menu bar before
  1814. calling TaskMasterDA, as it can't possibly know enough to switch menu bars for
  1815. you.)
  1816.  
  1817. --Matt
  1818.  
  1819.  
  1820.  
  1821. Type:      Response       
  1822. From:      AFC SteveB
  1823. Date:      91-12-28 16:41:09 EST
  1824. Re:        Matt
  1825.  
  1826. I've done all that; _TaskMasterDA still thinks that it was a control hit.  I'll
  1827. eximine it a little more and get back here.
  1828.  
  1829. Steve
  1830.